pp108 : browse Operation

browse Operation

 

 

This operation opens the Open File dialog box for the user to choose a file.

Syntax


sPath = object.browse(nIndex);

Parameters

Parameter

Description

nIndex

Integer value that specifies the index of the file element in the template file.

 

Return Value

 
Previously, it used to return the path of the file chosen from the Open File dialog box by the user. This feature is deprecated.

Now, it returns the selected file in the file-browse dialog of the onAfterBrowse event.

Remarks


This operation internally invokes the click operation on the file element in the template html file used by the upload component based on the index number which is supplied to it as a parameter. The index number starts from one.

Example


The following example shows how the browse operation is used to choose a file and also retrieve the path of the chosen file:

// uploader is the Id of the upload component
var chosenFilePath = uploader.browse(1);
// alert the path of the file returned by the browse operation
application.notify("The file chosen is " + chosenFilePath);

See Also


upload

Related reference

Upload
onAfterBrowse
onBeforeUpload
onupload Event
request Property
uploadFile Method